﻿<%@page import="util.Constants" %>
<%
    String section = (String) session.getAttribute("section");
    String message = (String) session.getAttribute("message");
    String messageType =  (String) session.getAttribute("messageType");

    //Only allow getting message one time.
    session.removeAttribute("message");
%>

<h2 style="width: 100%; text-align: center; display: block">Priority</h2>
<input type="hidden" name="selectedItemID" value=""/>

<div id="section-title">
    <%
    out.print(section);
    %>
</div>
<div id="toolbar">
    <a onclick="redirect(frmIndex, '<%=Constants.ADMIN_PAGE_NAME%>',
        '<%=Constants.PRIORITY_PAGE_NAME%>', '<%=Constants.PRIORITY_LIST%>')">View List</a>
    <a onclick="redirect(frmIndex, '<%=Constants.ADMIN_PAGE_NAME%>',
        '<%=Constants.PRIORITY_PAGE_NAME%>', '<%=Constants.PRIORITY_NEW%>')">New</a>
</div>
<div class="clear"></div>
<hr/>


<%
/*
 * Show message from server if it exists.
 */
if((message != null) && !"".equals(message)) {
    %>
    <div class="<%=messageType%>">
        <%
        out.print(message);
        %>
    </div>
    <%
}
%>

<%
/*
 * Show the selected section.
 */
if((section == null) || Constants.PRIORITY_LIST.equalsIgnoreCase(section) ) {
    controller.priorityController.showAllPriorities(out);
} else if(Constants.PRIORITY_EDIT.equalsIgnoreCase(section)) {
    %>
    <%@include file="edit.jsp" %>
    <%
} else if(Constants.PRIORITY_NEW.equalsIgnoreCase(section)) {
    %>
    <%@include file="insert.jsp" %>
    <%
}
%>
<div class="clear"></div>